/*--------------------------------------------------------------------------------*/
#ifndef __PROPERTY_TABLE__
#define __PROPERTY_TABLE__
/*--------------------------------------------------------------------------------*/
#include "primitives.h"
#include "text.h"
#include "object.h"
#include "util.h"
#include "math_vector_2.h"
#include "line_parser.h"
#include "debug.h"
#include "map.h"
/*--------------------------------------------------------------------------------*/
class PROPERTY_TABLE : public MAP< TEXT, TEXT >
{

	// -- PUBLIC

public:


    // .. CONSTRUCTORS

    PROPERTY_TABLE() : MAP()
    {

    }

    ~PROPERTY_TABLE()
    {
     
    }

    // .. METHODS

    INT GetInteger( const TEXT & name ) const
    {
    	DEBUG_Require( this->HasKey( name ) );

		return UTIL_GetIntegerFromText( this->operator []( name ) );
    }

    INT GetReal( const TEXT & name ) const
    {
    	DEBUG_Require( this->HasKey( name ) );

		return UTIL_GetRealFromText( this->operator []( name ) );
    }

    TEXT GetText( const TEXT & name ) const
    {
    	DEBUG_Require( this->HasKey( name ) );

    	return this->operator []( name );
    }

    const MATH_VECTOR_2 GetVector2( const TEXT & name ) const
    {
    	LINE_PARSER
    		parser( "*,*" );

    	DEBUG_Require( this->HasKey( name ) );

    	if( parser.Parse( this->operator []( name ) ) )
    	{
    		return MATH_VECTOR_2( parser.GetReal( 0 ), parser.GetReal( 1 ) );
    	}

    	DEBUG_Break( "Cannot parse" );

    	return MATH_VECTOR_2::Zero;
    }

    // -- PRIVATE

private :

    // .. ATTRIBUTES

    
};
/*--------------------------------------------------------------------------------*/
#endif
